home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-wchjis.ads < prev    next >
Text File  |  1996-01-30  |  4KB  |  71 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                       S Y S T E M . W C H _ J I S                        --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.4 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- The GNAT library is free software; you can redistribute it and/or modify --
  14. -- it under terms of the GNU Library General Public License as published by --
  15. -- the Free Software  Foundation; either version 2, or (at your option) any --
  16. -- later version.  The GNAT library is distributed in the hope that it will --
  17. -- be useful, but WITHOUT ANY WARRANTY;  without even  the implied warranty --
  18. -- of MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR PURPOSE.  See the  GNU --
  19. -- Library  General  Public  License for  more  details.  You  should  have --
  20. -- received  a copy of the GNU  Library  General Public License  along with --
  21. -- the GNAT library;  see the file  COPYING.LIB.  If not, write to the Free --
  22. -- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.        --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  This package contains routines used for converting between internal
  27. --  JIS codes and the two external forms we support (EUC and Shift-JIS)
  28.  
  29. package System.WCh_JIS is
  30. pragma Pure (WCh_JIS);
  31.  
  32.    function EUC_To_JIS (EUC1, EUC2 : Character) return Wide_Character;
  33.    --  Given the two bytes of a EUC representation, return the
  34.    --  corresponding JIS code wide character. Raises Constraint_Error
  35.    --  if the two characters are not a valid EUC encoding.
  36.  
  37.    procedure JIS_To_EUC
  38.      (J    : in Wide_Character;
  39.       EUC1 : out Character;
  40.       EUC2 : out Character);
  41.  
  42.    --  Given a wide character in JIS form, produce the corresponding
  43.    --  two bytes of the EUC representation of this character. This is
  44.    --  only used if J is not in the normal ASCII range, i.e. on entry
  45.    --  we know that Wide_Character'Pos (J) >= 16#0080# and that we
  46.    --  thus require a two byte EUC representation (ASCII codes appear
  47.    --  unchanged as a single byte in EUC). No error checking is performed,
  48.    --  the input code is assumed to be in an appropriate range.
  49.  
  50.    procedure JIS_To_Shift_JIS
  51.      (J   : in Wide_Character;
  52.       SJ1 : out Character;
  53.       SJ2 : out Character);
  54.    --  Given a wide character code in JIS form, produce the corresponding
  55.    --  two bytes of the Shift-JIS representation of this character. This
  56.    --  is only used if J is not in the normal ASCII range, i.e. on entry
  57.    --  we know that Wide_Character'Pos (J) >= 16#0080# and that we
  58.    --  thus require a two byte EUC representation (ASCII codes appear
  59.    --  unchanged as a single byte in EUC). No error checking is performed,
  60.    --  the input code is assumed to be in an appropriate range (note in
  61.    --  particular that input codes in the range 16#0080#-16#00FF#, i.e.
  62.    --  Hankaku Kana, do not appear, since Shift JIS has no representation
  63.    --  for such codes.
  64.  
  65.    function Shift_JIS_To_JIS (SJ1, SJ2 : Character) return Wide_Character;
  66.    --  Given the two bytes of a Shift-JIS representation, return the
  67.    --  corresponding JIS code wide character. Raises Constraint_Error if
  68.    --  the two characters are not a valid shift-JIS encoding.
  69.  
  70. end System.WCh_JIS;
  71.